/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tkatva.soalog.SoalogEjb.entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author tuomas
 */
@Entity
@Table(name = "loginterface_notification")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "LoginterfaceNotification.findAll", query = "SELECT l FROM LoginterfaceNotification l")})
public class LoginterfaceNotification implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "log_interface_notification_id")
    private Integer logInterfaceNotificationId;
    @Size(max = 500)
    @Column(name = "recipient_email")
    private String recipientEmail;
    @Size(max = 1000)
    @Column(name = "notification_desc")
    private String notificationDesc;
    @Size(max = 45)
    @Column(name = "interface_env")
    private String interfaceEnv;
    @JoinColumn(name = "log_interface_id", referencedColumnName = "log_interface_id")
    @ManyToOne(optional = false)
    private LogInterface logInterfaceId;

    public LoginterfaceNotification() {
    }

    public LoginterfaceNotification(Integer logInterfaceNotificationId) {
        this.logInterfaceNotificationId = logInterfaceNotificationId;
    }

    public Integer getLogInterfaceNotificationId() {
        return logInterfaceNotificationId;
    }

    public void setLogInterfaceNotificationId(Integer logInterfaceNotificationId) {
        this.logInterfaceNotificationId = logInterfaceNotificationId;
    }

    public String getRecipientEmail() {
        return recipientEmail;
    }

    public void setRecipientEmail(String recipientEmail) {
        this.recipientEmail = recipientEmail;
    }

    public String getNotificationDesc() {
        return notificationDesc;
    }

    public void setNotificationDesc(String notificationDesc) {
        this.notificationDesc = notificationDesc;
    }

    public String getInterfaceEnv() {
        return interfaceEnv;
    }

    public void setInterfaceEnv(String interfaceEnv) {
        this.interfaceEnv = interfaceEnv;
    }

    public LogInterface getLogInterfaceId() {
        return logInterfaceId;
    }

    public void setLogInterfaceId(LogInterface logInterfaceId) {
        this.logInterfaceId = logInterfaceId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (logInterfaceNotificationId != null ? logInterfaceNotificationId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LoginterfaceNotification)) {
            return false;
        }
        LoginterfaceNotification other = (LoginterfaceNotification) object;
        if ((this.logInterfaceNotificationId == null && other.logInterfaceNotificationId != null) || (this.logInterfaceNotificationId != null && !this.logInterfaceNotificationId.equals(other.logInterfaceNotificationId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tkatva.soalog.SoalogEjb.entities.LoginterfaceNotification[ logInterfaceNotificationId=" + logInterfaceNotificationId + " ]";
    }
    
}
